Skip to content

stabilize feature(cfg_target_has_atomic_equal_alignment)#155006

Merged
rust-bors[bot] merged 4 commits into
rust-lang:mainfrom
WaffleLapkin:stabilize_cfg_target_has_atomic_equal_alignment
May 18, 2026
Merged

stabilize feature(cfg_target_has_atomic_equal_alignment)#155006
rust-bors[bot] merged 4 commits into
rust-lang:mainfrom
WaffleLapkin:stabilize_cfg_target_has_atomic_equal_alignment

Conversation

@WaffleLapkin

@WaffleLapkin WaffleLapkin commented Apr 8, 2026

Copy link
Copy Markdown
Member

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Apr 8, 2026
@rustbot

rustbot commented Apr 8, 2026

Copy link
Copy Markdown
Collaborator

r? @mati865

rustbot has assigned @mati865.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 69 candidates
  • Random selection from 12 candidates

@WaffleLapkin WaffleLapkin force-pushed the stabilize_cfg_target_has_atomic_equal_alignment branch from 683bcac to e4bd7a8 Compare April 9, 2026 13:52
@rustbot

This comment has been minimized.

@traviscross traviscross added T-lang Relevant to the language team needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. I-lang-nominated Nominated for discussion during a lang team meeting. P-lang-drag-1 Lang team prioritization drag level 1. https://rust-lang.zulipchat.com/#narrow/channel/410516-t-lang labels Apr 10, 2026
@rust-bors

This comment has been minimized.

@WaffleLapkin WaffleLapkin added S-waiting-on-fcp Status: PR is in FCP and is awaiting for FCP to complete. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 12, 2026
@traviscross traviscross added the I-lang-radar Items that are on lang's radar and will need eventual work or consideration. label Apr 22, 2026
@traviscross

Copy link
Copy Markdown
Contributor

In the meeting today, we talked a bit about the name. Framing it as "target has {property}" seems right, especially in light of the existing target_has_atomic. But the word "equal" here is a bit unfortunate — one wonders, "equal to what?"

This cfg is testing that align_of::<Atomic<T>>() == align_of::<T>(). I.e., that the alignment of the atomic for some type T is the inner alignment — the alignment of the inner type.

What about target_has_atomic_inner_alignment?

@steffahn

steffahn commented Apr 22, 2026

Copy link
Copy Markdown
Member

One potential naming concern with cfg(target_has_atomic_equal_alignment="N") is that reading aloud something like target_has_atomic="32" can already read out aloud as something like “target has atomic equal[s] thirty-two”, so there’s potential confusion in adding the wordequal” in that same position where an ”equals“ sign appears for a different (related) cfg flag.

When looking for possible other names, it also makes sense to keep in mind that this flag is going to be used with a ="N"-kind of suffix (or ="8"/="16"/="32"/="64"/="ptr") indicating which atomic size we’re talking about.

@steffahn

Copy link
Copy Markdown
Member

Types like u8, u16… etc make up a majority of “primitive” types. See also std::primitive. So I’ve been thinking reference to primitive could help answer the question of “what is it supposed to be equal to?”

In the space of “names starting with target_has_atomic_”, I’m able to come up with things like the following.

  • #[cfg(target_has_atomic_alignment_matching_primitive="32")]
  • #[cfg(target_has_atomic_aligned_like_primitive="32")]
  • #[cfg(target_has_atomic_primitive_align="32")]

@WaffleLapkin

WaffleLapkin commented Apr 24, 2026

Copy link
Copy Markdown
Member Author

Out of the proposals above I like #[cfg(target_has_atomic_primitive_align="32")] the most (with close second being #[cfg(target_has_atomic_aligned_like_primitive="32")]). What would be the next step, should I re-nominate this to check if T-lang would be okay with that (or other) name(s), or?..

@traviscross

Copy link
Copy Markdown
Contributor

It's still nominated. We'll pick it back up to discuss.

@traviscross

Copy link
Copy Markdown
Contributor

We talked about this in the lang call today. Let's propose to do it with the name cfg(target_has_atomic_primitive_alignment).

@rfcbot fcp merge lang

@rust-rfcbot

rust-rfcbot commented May 6, 2026

Copy link
Copy Markdown
Collaborator

Team member @traviscross has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

cc @rust-lang/lang-advisors: FCP proposed for lang, please feel free to register concerns.
See this document for info about what commands tagged team members can give me.

@rust-rfcbot rust-rfcbot added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. labels May 6, 2026
@traviscross traviscross removed I-lang-nominated Nominated for discussion during a lang team meeting. P-lang-drag-1 Lang team prioritization drag level 1. https://rust-lang.zulipchat.com/#narrow/channel/410516-t-lang labels May 6, 2026
@rust-rfcbot rust-rfcbot added final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. and removed proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. labels May 6, 2026
@rust-rfcbot

Copy link
Copy Markdown
Collaborator

🔔 This is now entering its final comment period, as per the review above. 🔔

@rust-rfcbot

Copy link
Copy Markdown
Collaborator

The final comment period, with a disposition to merge, as per the review above, is now complete.

As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.

@WaffleLapkin

WaffleLapkin commented May 17, 2026

Copy link
Copy Markdown
Member Author

@rustbot ready

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 17, 2026
@mati865

mati865 commented May 18, 2026

Copy link
Copy Markdown
Member

r? @Urgau

I assume the approval is equivalent to r+.

@bors r=Urgau

@rust-bors

rust-bors Bot commented May 18, 2026

Copy link
Copy Markdown
Contributor

📋 This PR cannot be approved because it currently has the following label: S-waiting-on-fcp.

@Urgau Urgau removed the S-waiting-on-fcp Status: PR is in FCP and is awaiting for FCP to complete. label May 18, 2026
@Urgau

Urgau commented May 18, 2026

Copy link
Copy Markdown
Member

@bors r+

@rust-bors

rust-bors Bot commented May 18, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 2f69883 has been approved by Urgau

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 18, 2026
rust-bors Bot pushed a commit that referenced this pull request May 18, 2026
…uwer

Rollup of 13 pull requests

Successful merges:

 - #156709 (stdarch subtree update)
 - #155006 (stabilize `feature(cfg_target_has_atomic_equal_alignment)`)
 - #156444 (Implement `OsStr::split_at`)
 - #156582 (Allow `global_asm!` in statement positions)
 - #156661 (Remove `UncheckedIterator`)
 - #152367 (Derives `Copy` for `ffi::FromBytesUntilNulError`)
 - #156443 (Fix invalid suggestion for parenthesized break)
 - #156606 (Add pext/pdep as aliases for extract_bits/deposit_bits)
 - #156630 (Replace `println!` with `assert!` in HashMap documentation examples)
 - #156644 (Widen the result of `widening_mul`.)
 - #156653 (Update `sysinfo` version to `0.39.2`)
 - #156697 (Add diagnostic items for IoBufReader and StdinLock)
 - #156704 (reduce usage of `box_patterns` in tests)
@rust-bors rust-bors Bot merged commit 33d6fe7 into rust-lang:main May 18, 2026
11 checks passed
@rustbot rustbot added this to the 1.97.0 milestone May 18, 2026
rust-timer added a commit that referenced this pull request May 18, 2026
Rollup merge of #155006 - WaffleLapkin:stabilize_cfg_target_has_atomic_equal_alignment, r=Urgau

stabilize `feature(cfg_target_has_atomic_equal_alignment)`

See stabilization report: #93822 (comment)
cc @joshtriplett
@traviscross

Copy link
Copy Markdown
Contributor

cc @rust-lang/lang-docs @rust-lang/fls

@traviscross traviscross added needs-reference-pr This language change needs an approved Reference PR to proceed. missed-reference-pr This language change needed a Reference PR and was merged without it. relnotes Marks issues that should be documented in the release notes of the next release. labels May 19, 2026
ehuss added a commit to ehuss/reference that referenced this pull request May 19, 2026
@WaffleLapkin WaffleLapkin deleted the stabilize_cfg_target_has_atomic_equal_alignment branch May 27, 2026 13:18
github-actions Bot pushed a commit to rust-lang/stdarch that referenced this pull request Jun 8, 2026
…uwer

Rollup of 13 pull requests

Successful merges:

 - rust-lang/rust#156709 (stdarch subtree update)
 - rust-lang/rust#155006 (stabilize `feature(cfg_target_has_atomic_equal_alignment)`)
 - rust-lang/rust#156444 (Implement `OsStr::split_at`)
 - rust-lang/rust#156582 (Allow `global_asm!` in statement positions)
 - rust-lang/rust#156661 (Remove `UncheckedIterator`)
 - rust-lang/rust#152367 (Derives `Copy` for `ffi::FromBytesUntilNulError`)
 - rust-lang/rust#156443 (Fix invalid suggestion for parenthesized break)
 - rust-lang/rust#156606 (Add pext/pdep as aliases for extract_bits/deposit_bits)
 - rust-lang/rust#156630 (Replace `println!` with `assert!` in HashMap documentation examples)
 - rust-lang/rust#156644 (Widen the result of `widening_mul`.)
 - rust-lang/rust#156653 (Update `sysinfo` version to `0.39.2`)
 - rust-lang/rust#156697 (Add diagnostic items for IoBufReader and StdinLock)
 - rust-lang/rust#156704 (reduce usage of `box_patterns` in tests)
@traviscross traviscross added the has-reference-pr This language change has an approved Reference PR. label Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. has-reference-pr This language change has an approved Reference PR. I-lang-radar Items that are on lang's radar and will need eventual work or consideration. missed-reference-pr This language change needed a Reference PR and was merged without it. needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. needs-reference-pr This language change needs an approved Reference PR to proceed. relnotes Marks issues that should be documented in the release notes of the next release. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-lang Relevant to the language team T-libs Relevant to the library team, which will review and decide on the PR/issue. to-announce Announce this issue on triage meeting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants